class Solution {
public:
    long long zeroFilledSubarray(vector<int>& nums) {
        int left = 0, right = left;
        long long ret = 0;
        while(left < nums.size())
        {
            if(nums[left] == 0)
            {
                right = left;
                while(right < nums.size() && nums[right] == 0) right++;
                long long num = right - left;
                ret += (num + 1) * num / 2;
                left = right;
            }
            left++;
        }
        return ret;
    }
};